﻿<UserControl x:Class="Samba.Modules.TicketModule.DepartmentButtonView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <ItemsControl ItemsSource="{Binding TicketListViewModel.PermittedDepartments}" 
                  Visibility="{Binding TicketListViewModel.IsDepartmentSelectorVisible,Converter={StaticResource VisibilityConverter}}"
                  IsEnabled="{Binding TicketListViewModel.CanChangeDepartment}"
                  Margin="0,0,5,0">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <Button Margin="5,0,0,0" MinWidth="70" Content="{Binding Name}" Click="Button_Click" />
            </DataTemplate>
        </ItemsControl.ItemTemplate>
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <StackPanel Orientation="Horizontal">

                </StackPanel>
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
    </ItemsControl>
</UserControl>